package cn.edu.mju.common.entity.result;

/**
 * @author JB
 * @Classname AppHttpCodeEnum

 * @Date 2023/6/6 19:31
 * @Created by JB
 */
public enum  AppHttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),

    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"), EMAIL_EXIST(503, "邮箱已存在"),
    USERNAME_NOT_EXIST(510,"用户名不存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505,"用户名或密码错误"),

    USERID_EXIST(511,"用户id已存在"),
    USER_NOT_EXIST(512,"用户不存在"),

    USERID_NOT_NULL(506,"用户id不能为空"),
    NICKNAME_NOT_NULL(507,"用户昵称不能为空"),
    EMAIL_NOT_NULL(508,"邮箱不能为空"),

    PASSWORD_NOT_NULL(509,"密码不能为空"),
    CODE_NULL(421,"验证码不能为空"),
    CODE_ERROR(422,"验证码校验失败"),

    FILE_TYPE_ERROR(423,"文件上传类型错误,请上传png或者jpg格式文件"),

    UPDATE_ERROR(424,"用户信息修改失败"),

    DELETE_ERROR(425,"删除用户失败");


    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
